package com.rran.study.designpattern.behavioral.iterator;

/**
 * @author yy
 * @Type Test.java
 * @Desc
 * @date 2020/7/27 19:38
 */
public class Test {

    public static void main(String[] args){
        Aggregate ag=new ConcreteAggregate();
        ag.add("张三");
        ag.add("李四");
        ag.add("王五");
        System.out.print("聚合的内容有：");
        Iterator it=ag.getIterator();
        while(it.hasNext()){
            Object ob=it.next();
            System.out.print(ob.toString()+"\t");
        }
    }
}
